<html>
<head>
<title>test_coos_extend_event</title>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<script type="text/javascript" src="jsunit/app/jsUnitCore.js"></script>
<script type="text/javascript" src="../coos.js"></script>
<script type="text/javascript" src="../coos.extend.ajax.js"></script>
<script type="text/javascript">

//此函数会在页面加载后首先执行，并且只执行一次，类似于JUnit4中的@BeforeClass注解
function setUpPage()
{
	//此行代码必须放置在setUpPage的最后，在完成资源加载后告诉JsUnit该函数已执行完毕
	setUpPageStatus = "complete"; 
}


function setUp() //类比于JUnit中的setUp
{

}

function tearDown() //类比于JUnit中的tearDown
{

}

//test Ajax
function testGetAjax()
{
	var url = "../../coos/ajax_test.action?type=localhost";
	coos.ajax.sendGetRequest(url,getCallback,{test1:'aaa',test2:'bbb'});
	//coos.ajax.sendGetRequest(url,function(test1,test2,responseText){alert(responseText);alert(test1);},{test1:'aaa',test2:'bbb'});
}
function getCallback(test1,test2,responseText)
{
	var result = responseText;
	var str = '{"messagess":"ajaxTest"}';
	assertEquals(str,result);
}


//test GetRemoteRequest
function testGetRemoteRequest()
{
	var url = "http://zhengdz.iap111.com:8080/coos/coos/ajax_test.action?type=remote";
	coos.ajax.sendGetRemoteRequest(url,remoteRequestCallback,{test1:'aaa',test2:'bbb'},"remote_request");
}
function remoteRequestCallback(test1,test2,responseText)
{
	var result = test1;
	assertEquals('aaa',result);
}
</script>
</head>
<body>
<div id="testAjax">testAjax</div>
</body>
</html>